﻿using FastUtil.Base;
using Quartz.Spi;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Hosting;

namespace FastExecutor.ORG.Design
{
    public class FastSchedulerPlugin : ISchedulerPlugin
    {
        public void Initialize(string pluginName, global::Quartz.IScheduler sched)
        {
            DirectoryInfo SchedulerLogDir = new DirectoryInfo(HostingEnvironment.MapPath("~/Log/TaskSchedulerLog"));
            if (!SchedulerLogDir.Exists)
            {
                SchedulerLogDir.Create();
            }
            LogUtil.WriteLog("Logs/TaskSchedulerLog", "log_", "任务调度器初始化!");
        }

        public void Shutdown()
        {
            LogUtil.WriteLog("Logs/TaskSchedulerLog", "log_", "任务调度器关闭!");
        }

        public void Start()
        {
            LogUtil.WriteLog("Logs/TaskSchedulerLog", "log_", "调度器开始运行!");
        }
    }
}
